﻿@{
    ViewBag.Title = "Services";
}
<h3>
    Location</h3>
@using (Html.BeginForm("UpdateLocation", "Services"))
{
    <input type="hidden" name="userid" value="sample" />
    <input type="hidden" name="passhash" value="sample2" />
    <input type="hidden" name="latitude" value="30.283" />
    <input type="hidden" name="longitude" value="-97.7325" />
    <input type="submit" value="Updatelocation for sample driver" /> 
    <span style="color: gray">Call this service to update driver location. Text confirmation
        returned</span>
}
<br />
@Html.ActionLink("GetAllDriverLocations(latitude = 30.2, longitude = -97.6)", "GetAllDriverLocations", new { latitude = 30, longitude = -97.6 })
<br />
@Html.ActionLink("GetAllDriverLocationsNearMe(latitude = 30.2, longitude = -97.6, radius = 500, includeAddress=true)", "GetAllDriverLocationsNearMe", new { latitude = 30, longitude = -97.6, radius = 500, includeAddress = true })<br />
@Html.ActionLink("GetNthClosestDriverLocationToMe(latitude = 30.2, longitude = -97.6, nth=2)", "GetNthClosestDriverLocationToMe", new { latitude = 30, longitude = -97.6, nth = 2 })
<h3>
    Messages</h3>
<div style="border: 1px solid gray; padding: 3px; width: 700px">
    @using (Html.BeginForm("SendMessage", "Services"))
    {
        <span>Sender:</span> @Html.DropDownList("senderUserId", HtmlUtil.RenderDrivers())    <br />
        <span>Recipient:</span> @Html.DropDownList("recipientUserId", HtmlUtil.RenderDrivers(null, false, true))  <br />
        <span>Message:</span> @Html.TextBox("messageText")                     <br />                                                                   
        <span>Message Type:</span> @Html.TextBox("messageType")<br />
        <span>ParentMessageId:</span> @Html.TextBox("parentMessageId")<br />
        <input type="hidden" name="passhash" value="sample2" />
        <input type="hidden" name="statusmessage" value="had a flat tire" />
        <input type="hidden" name="statusreason" value="mechantical problem" />
        
        <input type="submit" value="SendMessage()" />                                                                                                   
        <span style="color: gray">Call this service to send message to a driver. Text confirmation
            returned.</span>
    }
</div>
<br />
<div style="border: 1px solid gray; padding: 3px; width: 700px">
    @using (Html.BeginForm("UpdateDriverAck", "Services"))
    {
        <span>Recipient (sample driver):</span> <input type="text" name="recipientUserId"
            value="sample" /><br />
        <text>Driver Ack:</text><input type="text" name="ackNumber" value="1" style="width: 50px" /><br />
        <input type="submit" value="UpdateDriverAck()" />                                                                                               
        <span style="color: gray">Call this service to acknowledge message reciept.</span>
    }
</div>
<br />
<br />
@Html.ActionLink("GetAllMessages(UserID=sample)", "GetAllMessages", "Services", new { UserID = "sample" }, null)
<span style="color: gray">Call this service to get all messages for user (returned as
    JSON) (click this link to test)</span><br />
<br />
@Html.ActionLink("GetAllMessagesSinceAck(UserID=sample)", "GetAllMessagesSinceAck", "Services", new { UserID = "sample" }, null)
<span style="color: gray">Call this service to get all messages for user since last
    ACK Number (since the last ACK sent via the UpdateDrierAck() service call</span>
<br />
<h3>
    Status</h3>
@using (Html.BeginForm("UpdateStatus", "Services"))
{
    <input type="hidden" name="userid" value="sample" />
    <input type="hidden" name="passhash" value="sample2" />
    <input type="hidden" name="statusmessage" value="had a flat tire" />
    <input type="hidden" name="statusreason" value="mechanical problem" />
    <input type="submit" value="UpdateStatus()" />                                                                                                   
    <span style="color: gray">Call this service to update driver status. Text confirmation
        returned. parameters: userid=sample,passhash=sample2,statusmessage='had a flat tire',statusreason='mechanical
        problem'</span>
}<br />
<br />
<br />
<br />
<br />
<br />
@*@Html.ActionLink("Test Page", "Test")*@ 